package org.jeecg.modules.charge.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.modules.system.entity.SysDepart;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;

/**
 * <p>
 * 业主与租户以及房间的实体类
 * <p>
 * 
 * @Author Steve
 * @Since 2019-01-22 
 */
@Data
public class ChargeGenerateModel implements Serializable{

    private static final long serialVersionUID = 1L;

    /*房间名称*/
    private String roomName;
    /*房间面积*/
    private String buildArea;
    /*业主名称*/
    private String customerName;
    /*租户名称*/
    private String tenantName;
    /*迁入时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date putDate;
    /*收费时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date chargeTime;

    /*结束时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date outDate;

    /*房屋属性*/
    @Dict(dicCode = "room_property")
    private String roomProperty;

    /*房间id*/
    private String roomId;

    /*业主id*/
    private String customerId;

    /*租户id*/
    private String tenantsId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ChargeGenerateModel that = (ChargeGenerateModel) o;
        return Objects.equals(roomName, that.roomName) &&
                Objects.equals(buildArea, that.buildArea) &&
                Objects.equals(customerName, that.customerName) &&
                Objects.equals(tenantName, that.tenantName) &&
                Objects.equals(putDate, that.putDate) &&
                Objects.equals(outDate, that.outDate) &&
                Objects.equals(roomProperty, that.roomProperty) &&
                Objects.equals(roomId, that.roomId) &&
                Objects.equals(customerId, that.customerId) &&
                Objects.equals(tenantsId, that.tenantsId);
    }

    @Override
    public int hashCode() {

        return Objects.hash(roomName, buildArea, customerName, tenantName, putDate, outDate, roomProperty, roomId, customerId, tenantsId);
    }


}
